<?php
session_start();
include "library.php";
if(!isset($_SESSION["username"])){
	header("Location:login.php");
}

if(isset($_POST["logout"])){	
	session_unset();
	session_destroy();
	header("Location:home.php");
}

//Ensure that user is coming from correct page
if(!isset($_SESSION["file_name"])){
	header("Location:members.php");
}

//Redirect User based on pressing buttons
if(isset($_POST["press1"])){
	header("Location:UpFile.php");
}

if(isset($_POST["press2"])){
	header("Location:members.php");
}

//Display Thank You message with file name
echo "File Uploaded Succesfully<BR><BR>".$_SESSION["file_name"]."<BR><BR>";

//Display buttons to go upload another file or 
?>
<form method = 'post'>
<input type = 'submit' name = 'press1' value = 'Upload Another File' /><br />
<input type = 'submit' name = 'press2' value = 'Home Page' /><br />
</form>
